home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Jan 90 / MacApp.Tech$ 1⁄12⁄90 / 0392-AssumeFocused Errors-Jan90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.6 KB  |  49 lines  |  [TEXT/GEOL]

  1. Item    8837423                         11-Jan-90        10:29
  2.  
  3. From:   D5369                           Mgmt Sys Des, Chuck McMath,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    AssumeFocused Errors…
  8.  
  9. Can you _ALWAYS_ avoid AssumeFocused errors?
  10.  
  11. When I create a window it tries to determine its size (variable sized view).
  12. At the end of my DoMakeViews method, I initialize my view.  In the view
  13. initialization code I make these calls:
  14.  
  15.                     IF SELF.Focus THEN ;
  16.                     SampleToScreen(0, origin);
  17.  
  18. SampleToScreen looks like this:
  19.  
  20.         PROCEDURE TAudioView.SampleToScreen(theSample: LongInt;
  21.                         VAR theScreen: INTEGER);
  22.         VAR
  23.             vTemp: VPoint;
  24.             tempPt:Point;
  25.         BEGIN
  26.             SetVPt(vTemp, (theSample  DIV fDispScale) + kSoundBarInset, 0);
  27.             tempPt := ViewToQDPt(vTemp);
  28.             theScreen := tempPt.h;
  29.         END;   { TAudioView.SampleToScreen }
  30.  
  31.  
  32.  
  33. I get an AssumeFocused failure in ViewToQDPt, so the Focus operation _must_ be
  34. failing.  The window/view are not visible at this point, and looking at Focus
  35. makes me pretty sure that that's why it doesn't work right at the beginning.
  36.  
  37. Is there any way to avoid this other than perhaps by making my window/view
  38. visible as early as possible?
  39.  
  40.  
  41. [NOTE: I know Focusing was discussed a few months ago here, but I am posting
  42. this because a knowledgeable friend insisted that _all_ AssumeFocused problems
  43. indicated errors on my part, and I don't believe him].
  44.  
  45. Thanks.
  46.  
  47.                                         chuck mcmath
  48.  
  49.